cmake_minimum_required(VERSION 3.4.1)

set(COMMON_COMPILER_FLAGS "-Wno-deprecated -O3 -fstrict-aliasing -fvisibility=hidden -ffunction-sections -fdata-sections")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILER_FLAGS} -std=c++14")
set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   ${COMMON_COMPILER_FLAGS}")

add_definitions(
	-DAVOID_TABLES
	-DDISABLE_IMPORTGL
	-DLUA_USE_DLOPEN
	-DLUA_USE_POSIX
	-DRtt_DEBUG
)

add_library( engine
        napi/file/RawFileUtils.cpp
		napi/font/TextBitmap.cpp
        napi/helper/Js_GameEngineHelper.cpp
		napi/helper/NapiHelper.cpp
		napi/helper/NapiValueConverter.cpp
		napi/editbox/InputNapi.cpp
		napi/editbox/TextInfoMap.cpp
		napi/webview/WebViewNapi.cpp
		napi/modules/OHAudioUtils.cpp
		napi/modules/SensorNapi.cpp

		napi/render/egl_core.cpp
		napi/render/plugin_render.cpp
		napi/input/InputHandler.cpp
		napi/native_manager.cpp
		napi/plugin_manager.cpp
		napi/WorkerMessageQueue.cpp

		napi/video/VideoPlayerInfo.cpp
		napi/video/GlobalInfoMap.cpp
		napi/video/VideoPlayerNapi.cpp

        OhosEditBoxHandler.cpp
        OhosVideoPlayerHandler.cpp
        OhosWebviewHandler.cpp
        # TODO add your C++ file here

)

target_link_libraries ( engine PUBLIC
    GLESv3
    EGL
    ace_ndk.z
    dl
    uv
    libhilog_ndk.z.so
    libace_napi.z.so
    librawfile.z.so
    libnative_drawing.so
    z
    libOpenSLES.so
    libohaudio.so
    libpixelmap_ndk.z.so
    libimage_source_ndk.z.so
    libimage_packer_ndk.z.so
    )

target_include_directories ( engine PUBLIC
	.
#    ${ANDROID_NDK_ROOT}/sources/android/cpufeatures
)